package com.google.code.b0rx0r.advancedSamplerEngine;


public interface Enqueueable {
	public static final float NO_MORE_AUDIO_DATA = Float.MAX_VALUE;
	public static final long UNKNOWN = Long.MAX_VALUE;
	
	/** @return the length of the enqueueable, 
	 *          or UNKNOWN if length can't easily be determined. */
	long getLength();
	
	/**
	 * 	 * @return the number of channels this Enqueueable has
	 */
	int getChannelCount();
	
	/** 
	 * @param channel
	 * @param offset
	 * @return a single sample of audio data for the given channel and offset,
	 *          or NO_MORE_AUDIO_DATA if there's no more data.
	 */
	float getAudioData(int channel, long offset);
	
	
	/** suggests to the Enqueueable that it should prepare the data for the given timeframe.
	 *  Will be called by the Engine before a corresponding sequence of calls to getAudioData.
	 * @param start
	 * @param length
	 */
	void prepareData(long start, long length);

	/**
	 *  @return the outputmap for this enqueueable
	 */
	ChannelOutputMap getOutputMap();

	/** for modulations that depend on the global time (e.g. lfos), we need to tell them that time. */ 
  void setModulationGlobalOffset(long offset);
}
